<%--供号商登录后,查看sp的页面,每个sp对应的要能看到流水--%>
<%@ taglib prefix="page" uri="http://com.qipay/pagelib" %>
<%@ page language="java" import="com.qipay.admin.utils.SiteHelper" contentType="text/html;charset=utf-8" %>
<%@ page import="com.qipay.baas.model.Sp" %>
<%@ page import="com.qipay.core.entity.Pagination" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<!doctype html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <jsp:include page="head.jsp"></jsp:include>
    <link rel="stylesheet" href="<%= request.getAttribute("StaticHost") %>/css/dataTables.bootstrap.min.css">
    <link rel="stylesheet" href="<%= request.getAttribute("StaticHost") %>/css/list.css">
    <link rel="stylesheet" href="<%= request.getAttribute("StaticHost") %>/css/bootstrap-datepicker3.min.css">
    <link rel="stylesheet" href="<%= request.getAttribute("StaticHost") %>/css/datetimepicker.css">

    <style>
        #loading{
            width:100%;
            height:100%;
            border:3px solid #C3DAF9;
            position:absolute;
            top:0px;
            left:0px;
            z-index:10000;
            background-color:#F7F9FC;
            line-height:900px;
            text-align: center;
            vertical-align:middle;
            font-size:11pt;
            display:none;
            opacity: 0.4;
        }
    </style>
    <script type="text/javascript">
        //document.getElementsByTagName("html")[0].style.width=screen.availWidth/100+"px";
        document.getElementsByTagName("html")[0].style.fontSize = screen.availWidth / 200 + "px";
    </script>
    <style type="text/css">
        .border {
            border: 1px solid red;
        }
    </style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <jsp:include page="nav.jsp"></jsp:include>
    <jsp:include page="left.jsp"></jsp:include>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">支付宝通道列表</h3>
                        </div>
                        <%
                            Map<String, String> params = (Map<String, String>) request.getAttribute("params");
                            String total = (String)request.getAttribute("total");
                         %>
                        <div >
                            <form id="searchForm" action="/spUser/spListQuery" >

                                <div class="new-group date form_datetime">
                                    <label for="from">开始日期：</label>
                                    <input type="text" id="from" name="from" readonly
                                           value="<%= params.containsKey("from") ?params.get("from"):""%>" data-date-format="yyyy-mm-dd hh:ii">
                                </div>
                                <div class="new-group date form_datetime">
                                    <label for="to">结束日期：</label>
                                    <input type="text" id="to" name="to" readonly
                                           value="<%= params.containsKey("to") ?params.get("to"):""%>" data-date-format="yyyy-mm-dd hh:ii">
                                </div>
                                <div class="button-group">
                                    <button type=" submit" class="button back-green" id="btnSearch" style="font-size: 1rem">查询</button>
                                </div>
                            </form>
                            <div style="clear: both"></div>
                        </div>

                        <!-- /.box-header -->
                        <div class="tableContent">
                            <table width="100%" cellspacing="0" cellpadding="0" border="1">
                                <thead>
                                <tr>
                                    <th width="3%">ID</th>
                                    <th width="5%">SP名称</th>
                                    <%--<th width="8%">商户ID</th>--%>
                                    <th width="10%">服务</th>
                                    <th width="10%">渠道</th>
                                    <th width="5%">供号商</th>
                                    <th width="10%">流水量</th>
                                    <th width="10%">加入时间</th>
                                    <th width="3%">状态</th>
                                    <th width="10%">通道状态</th>
                                    <th width="10%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <% List<Sp> articles = (List<Sp>) request.getAttribute("spList");
                                    Pagination pagination = (Pagination) request.getAttribute("pagination");
                                    if (articles != null && articles.size() > 0) {
                                        Iterator<Sp> iter = articles.iterator();
                                        Sp user = null;
                                        while (iter.hasNext()) {
                                            user = iter.next();

                                %>
                                <tr id="user_<%=user.getId()%>">
                                    <td><%=user.getId()%>
                                    </td>
                                    <td><%=user.getName()%>
                                    </td>
                                    <%--<td><%=user.getMchId()%>--%>
                                    </td>
                                    <td>
                                        <%= user.getService()%>
                                    </td>
                                    <td>
                                        <%--<a href="${pageContext.request.contextPath}/sp?bank=<%= user.getBank()%>"
                                           style="color: #00a65a">--%>
                                        <%= user.getBank()%>
                                        </a><%----%>
                                    </td>
                                    <td>
                                        <%= user.getSpUserName()%>
                                    </td>
                                    <td>
                                        <%= user.getCardNo()%>
                                    </td>
                                    <td>
                                        <%= SiteHelper.getDefaultTimeFormat(user.getCreateDate())%>
                                    </td>
                                    <td id="trgoods<%= user.getId()%>"
                                        class="<%= user.getState()!=null&&user.getState()==0?"success":""%>"><%= SiteHelper.getChannelStateString(user.getState())%>
                                    </td>
                                    <td>
                                        <%if (user.getFailReason() == null) {%>
                                        <span style="color: #00e765">正常</span>
                                        <%} else {%>
                                        <span style="color: red"><%= user.getFailReason()%></span>
                                        <%}%>
                                    </td>
                                    <td>
                                        <%-- 供号商只能查看流水--%>
                                        <!--<button type="button"
                                                class="button back-red"
                                                onclick="lookSpuserOrderList(<%=user.getId()%>,true)"
                                                data-toggle="modal"
                                                data-target="#spuser_orderlist"
                                                style="font-size: 1rem">
                                            查看流水
                                        </button>-->
                                    </td>
                                </tr>

                                <%
                                    }
                                } else {
                                %>
                                <tr>
                                    <td colspan="5">no data.</td>
                                </tr>
                                <% }%>
                                <tr>
                                    <td colspan="10" style="text-align:left;border:1px solid #dcdcdc">总金额 :<%=total%>&nbsp&nbsp</td>
                                </tr>
                                </tbody>
                            </table>
                             <%
                                String query = (String)request.getAttribute("query");

                                %>


                            <div class="col-sm-10">

                                <div class="dataTables_paginate paging_simple_numbers" id="example1_paginate">
                                    <page:page totalSum="<%= pagination.getTotal()%>"
                                               url="<%=query%>"
                                               pageNo="<%= pagination.getPage()%>"
                                               pageSize="<%= pagination.getPageSize()%>"></page:page>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>


    <!-- /.content-wrapper -->
    <jsp:include page="foot.jsp"></jsp:include>
</div>
<script src="<%= request.getAttribute("StaticHost") %>/js/bootstrap-datepicker.min.js"></script>
<script src="<%= request.getAttribute("StaticHost") %>/js/bootstrap-datepicker.zh-CN.min.js"></script>
<script src="<%= request.getAttribute("StaticHost") %>/js/dataTables.bootstrap.min.js"></script>
<script src="<%= request.getAttribute("StaticHost") %>/js/adminlte.min.js"></script>
<script src="<%= request.getAttribute("StaticHost") %>/js/bootstrap-datetimepicker.min.js"></script>
<script>
    $(function () {
        $('#from, #to').datetimepicker({
            autoclose: true,
            todayBtn: true,
            clearBtn: true,
            language: "zh-CN"});
    });
</script>
</body>
</html>

